//
//  welcomeViewController.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/11.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "welcomeViewController.h"
#import "loginViewController.h"
#import "registerViewController.h"

@interface welcomeViewController ()

@end

@implementation welcomeViewController

- (void)viewWillAppear:(BOOL)animated{

    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated{

    [self.navigationController setNavigationBarHidden:NO animated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
    self.title = @"账号登录";
}

#pragma mark ----------------------- init ---------------------

- (void)initView{
    
    UIImageView *bgImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, scrWidth(), scrHeight())];
    bgImg.image = [UIImage imageNamed:@"Rectangle 29"];
    [self.view addSubview:bgImg];
    
    UIImageView *logoImg = [[UIImageView alloc]initWithFrame:CGRectMake( (scrWidth()-screenScale(154))/2, screenScale(150), screenScale(154), screenScale(65))];
    logoImg.image = [UIImage imageNamed:@"logo2-1"];
    [self.view addSubview:logoImg];
    
    UIButton *loginBtn = [ConfigXp buttonWithFrame:CGRectMake(screenScale(30), screenScale(484), screenScale(315), screenScale(44))
                                             title:@"登录"
                                        titleColor:getColor(@"ffffff")
                                              font:get4sFont(12)
                                   backgroundColor:getColor(@"3a95ff")
                                             image:nil];
    loginBtn.layer.cornerRadius = screenScale(3);
    [loginBtn addTarget:self action:@selector(loginBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:loginBtn];
    
    UIButton *registerBtn = [ConfigXp buttonWithFrame:CGRectMake(screenScale(30), screenScale(543), screenScale(315), screenScale(44))
                                             title:@"注册"
                                        titleColor:getColor(@"666666")
                                              font:get4sFont(12)
                                   backgroundColor:getColor(@"ffffff")
                                             image:nil];
    registerBtn.layer.cornerRadius = screenScale(3);
    [registerBtn addTarget:self action:@selector(registerBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:registerBtn];
    
    ///
    
    UIImageView *wechat = [[UIImageView alloc]initWithFrame:CGRectMake(screenScale(80), screenScale(617), screenScale(20), screenScale(20))];
    wechat.image = [UIImage imageNamed:@"wechat_login"];
    [self.view addSubview:wechat];
    
    UIButton *wechatBtn = [ConfigXp buttonWithFrame:CGRectMake(screenScale(105), screenScale(618), screenScale(60), screenScale(18))
                                              title:@"微信登陆"
                                         titleColor:getColor(@"6b6b6b")
                                               font:get4sFont(11)
                                    backgroundColor:nil
                                              image:nil];
    [wechatBtn addTarget:self action:@selector(wechatBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:wechatBtn];
    
    ///
    
    UIImageView *tencet = [[UIImageView alloc]initWithFrame:CGRectMake(screenScale(227), screenScale(617), screenScale(20), screenScale(20))];
    tencet.image = [UIImage imageNamed:@"wechat_login"];
    [self.view addSubview:tencet];
    
    UIButton *tencetBtn = [ConfigXp buttonWithFrame:CGRectMake(screenScale(249), screenScale(618), screenScale(60), screenScale(18))
                                              title:@"QQ登陆"
                                         titleColor:getColor(@"6b6b6b")
                                               font:get4sFont(11)
                                    backgroundColor:nil
                                              image:nil];
    [tencetBtn addTarget:self action:@selector(tencetBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:tencetBtn];
    

    
}

#pragma mark ----------------------- click ---------------------

- (void)loginBtnClick{

    loginViewController *vc = [[loginViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)registerBtnClick{

    registerViewController *vc = [[registerViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)wechatBtnClick{

    
}

- (void)tencetBtnClick{

    
}

@end
